(function () {
    angular.module('app')
        .factory('UpdateStockFactory',fn);
    function fn(urlCnst,mockHttp) {
        var self = {};

        self.getAllDrug = function (body, cb) {
            if( !urlCnst['mockHttp'] ){
                urlCnst.get('url',body,cb);
                return;
            }
            var drug = mockHttp.allDrug;
            return cb(drug['err'],drug);
        };
        self.getStockInfoById = function (drugId, shopId, cb) {
            urlCnst.post('update-stock/' + shopId + '/' + drugId, cb);
        };
        self.updateStock = function (shopId, drugId, updateNumber, cb) {
            urlCnst.post('update-stock/' + shopId + '/' + drugId + updateNumber, cb);
        };
        return self;
    }
})();